#36 new
candland

Lovely Website, Carry on the good work.

Reported by candland | May 17th, 2011 @ 04:18 PM

Not sure why this started, it had been working fine, and no known changes in the data being processed.

https://gist.github.com/ae17ab0ff656db0f800c


You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.empty?

Trace:
ri_cal (0.8.8) lib/ri_cal/component/timezone.rb:105:in period_for_local' ri_cal (0.8.8) lib/ri_cal/component/timezone.rb:31:inrational_utc_offset'
ri_cal (0.8.8) lib/ri_cal/property_value/date_time/timezone_support.rb:61:in rational_tz_offset' ri_cal (0.8.8) lib/ri_cal/property_value/date_time.rb:312:inruby_value'
ri_cal (0.8.8) lib/ri_cal/properties/event.rb:597:in dtend' vendor/engines/fms_members/app/lib/import_events.rb:33:inblock (2 levels) in import'
...


UID: BEGIN:VEVENT
CREATED;VALUE=DATE-TIME:20110318T184134Z
DTEND;TZID=America/Denver;VALUE=DATE-TIME:20110318T220000
DTSTART;TZID=America/Denver;VALUE=DATE-TIME:20110318T180000
DTSTAMP;VALUE=DATE-TIME:20110516T224545Z
LAST-MODIFIED;VALUE=DATE-TIME:20110318T184134Z
UID:1459579@supersaas.com
DESCRIPTION:Grand Opening Event\nFluid Meeting Spaces
URL:http://www.supersaas.com/schedule/Fluid_Meeting_Spaces/FluidMeeting...
SUMMARY:Fluid Coffee Bar
END:VEVENT

Comments and changes to this ticket

  • candland

    candland May 20th, 2011 @ 12:14 PM

    Seems like this method might be the issue: The problems seems to be that the ical feed doesn't have a STANDARD section, only a DAYLIGHT.

    /lib/ri_cal/component/timezone.rb:50

        # Returns the set of TimezonePeriod instances that are valid for the given
        # local time as an array. If you just want a single period, use
        # period_for_local instead and specify how ambiguities should be resolved.
        # Returns an empty array if no periods are found for the given time.
        def periods_for_local(local)
          local = local.to_ri_cal_date_time_value
          candidate_standard = last_before_local(standard, local)
          candidate_daylight = last_before_local(daylight, local)
          if candidate_daylight && candidate_daylight.swallows_local?(local, candidate_standard)
            []  # Invalid local time
          elsif candidate_standard
            if candidate_daylight
              if candidate_daylight.dtstart > candidate_standard.dtstart
                [candidate_daylight]
              elsif candidate_standard.ambiguous_local?(local)
                [candidate_daylight, candidate_standard]
              else
                [candidate_standard].compact
              end
            else
              [candidate_standard].compact
            end
          end
        end
    

    mst = <<MST
    BEGIN:VCALENDAR
    PRODID:-//SuperSaaS//Super Schedule//EN
    METHOD:PUBLISH
    VERSION:2.0
    CALSCALE:GREGORIAN
    X-WR-CALNAME:Fluid Meeting Space
    X-WR-TIMEZONE:America/Denver
    X-WR-RELCALID:40409
    BEGIN:VTIMEZONE
    TZID:America/Denver
    BEGIN:DAYLIGHT
    TZOFFSETFROM:-0700
    TZOFFSETTO:-0600
    DTSTART:20110313T030000
    RDATE:20110313T030000
    TZNAME:MDT
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    UID:1641738@supersaas.com
    DTSTAMP:20110519T192544Z
    DTSTART;TZID=America/Denver:20110428T120000
    DTEND;TZID=America/Denver:20110428T130000
    SUMMARY:Dusty
    DESCRIPTION:Test Meeting
    CREATED:20110428T210637Z
    LAST-MODIFIED:20110428T210637Z
    URL:http://www.supersaas.com/schedule/red27/Fluid_Meeting_Space?year=20...
    onth=4&day=28 END:VEVENT
    END:VCALENDAR
    MST

    Is this a ical issue or a ri_cal issue?

  • candland

    candland May 20th, 2011 @ 12:49 PM

    Here's the code I ended up using.

    module RiCal
        class Component
            class Timezone < Component
                def periods_for_local(local)
                    puts "PATCHED Periods for local"
    
                    local = local.to_ri_cal_date_time_value
                    candidate_standard = last_before_local(standard, local)
                    candidate_daylight = last_before_local(daylight, local)
                    if candidate_daylight && candidate_daylight.swallows_local?(local, candidate_standard)
                        []  # Invalid local time
                    elsif candidate_standard
                        if candidate_daylight
                            if candidate_daylight.dtstart > candidate_standard.dtstart
                                [candidate_daylight]
                            elsif candidate_standard.ambiguous_local?(local)
                                [candidate_daylight, candidate_standard]
                            else
                                [candidate_standard].compact
                            end
                        else
                            [candidate_standard].compact
                        end
                    elsif candidate_daylight
                        [candidate_daylight]
                    end
                end
            end
        end
    end
    
  • carlosbrab (at mail)

    carlosbrab (at mail) January 18th, 2015 @ 05:27 PM

    • Title changed from “You have a nil object when you didn't expect it! - DTSTART” to “Lovely Website, Carry on the good work.”
    • Assigned user set to “Rick DeNatale”

    Thank you! I value this.
    This is really interesting, You are a very skilled blogger. I have joined your rss feed and look forward to seeking more of your great post
    Here is my blog - http://www.onlinecigarettestoreus.com/

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A new icalendar data (RFC 2445) gem for Ruby which supports time zones and enumeration of occurrences

Shared Ticket Bins

People watching this ticket

Pages